package com.hgq.tenadmin.md.contactman.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hgq.tenadmin.md.contactman.dao.ContactManDao;
import com.hgq.tenadmin.md.contactman.service.ContactManService;
import com.hgq.tencommon.entity.md.contactman.ContactMan;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ContactManServiceImpl implements ContactManService {
    @Resource
    private ContactManDao contactManDao;

    @Override
    public PageInfo<ContactMan> selectAllContact(String linkClient, String salePrincipal, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ContactMan> contactMEN = contactManDao.selectAllContact(linkClient, salePrincipal);
        PageInfo<ContactMan> contactManPageInfo = new PageInfo<>(contactMEN);
        return contactManPageInfo;
    }

    @Override
    public void insertOneContactMan(ContactMan contactMan) {
        contactManDao.insertOneContactMan(contactMan);
    }
}
